<?php
namespace app\home\model;
use think\Model;
class Movies extends Model
{
    protected $pd = 'id';
    protected $schema = [
        'id'            => 'int',
        'title'         => 'string',
        'addtime'       => 'datetime',
        'content'       => 'string',
        'image'         => 'string',
        'source'        => 'string',
        'hot_order'     => 'int',
        'from_other'    => 'int',
        'iframe_url'    => 'string',
    ];
    public function getAddtimeAttr($value)
    {
        return get_date($value);
    }
    public function getIframeUrlAttr($value, $data)
    {
        return 'http://'.$_SERVER['HTTP_HOST'].'/movieplay/iframe?vid='.$data['id'];
    }
}